﻿using System;
using System.Collections.Generic;
using Gameplay.PVE.Utils;
using UnityEngine;
using XLua;
using Yoozoo.Framework.Core;

namespace Gameplay.PVE.Survivor
{
    public class BattleRpgNpcConfig
    {
        public int id;
        public int res_id;
        public int hp;
        public int atk;
        public int def;
        public float radius;
        public float move_speed;
        public List<int> ai;
        public float hud_offset;
        public List<Vector2Int> bubble;
    }
    
    public partial class BattleConfigManager
    {
        private Dictionary<int, BattleRpgNpcConfig> npcConfigMap;
        public BattleRpgNpcConfig GetNpcConfig(int id)
        {
            if (npcConfigMap.TryGetValue(id,out var config))
            {
                return config;
            }
            UnityEngine.Debug.LogError("NPC配表不存在id:"+id);
            return null;
        }
        public static void PreloadNPCConfig(LuaTable table)
        {
            PveUtils.PreloadRpgConfig(table,ref Instance.npcConfigMap);
        }
    }
}
